package cn.study.luckyapp.prize.query;

import cn.study.luckyapp.assembler.PrizeAssembler;
import cn.study.luckyclient.dto.data.PrizeVo;
import cn.study.luckyclient.dto.query.PrizeListByParamQuery;
import cn.study.luckydomain.gateway.PrizeGateway;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

@AllArgsConstructor
@Component
public class PrizeListByParamQueryExe {
    private final PrizeGateway prizeGateway;
    public IPage<PrizeVo> execute(PrizeListByParamQuery query){
        return prizeGateway.query(query).convert(PrizeAssembler::addPrizeVo);
    }
}
